CC = g++
SWIG ?= swig

#Windows: see ../README ../Makefile.win
PYTHON_INCLUDEDIR ?= /usr/include/python2.3

CFLAGS = -O3 -I$(PYTHON_INCLUDEDIR) -I..
LDFLAGS = -shared

all: svmc.so

svmc.so: svmc_wrap.o ../svm.o
	$(CC) $(LDFLAGS) -o svmc.so svmc_wrap.o ../svm.o

svmc_wrap.o: svmc_wrap.c ../svm.h
	$(CC) $(CFLAGS) -c svmc_wrap.c

svmc_wrap.c: svmc.i
	$(SWIG) -python -noproxy svmc.i

../svm.o: ../svm.cpp ../svm.h	
	cd ..; make svm.o

clean:
	rm -f *~ *.o *.so *.pyc *.pyo ../svm.o

moreclean:	clean
	rm -f svmc_wrap.c
